<script setup lang="ts">
  import { BasicModal, useModalInner } from '@/components/Modal';
  import { ref } from 'vue';
  import CodeModule from '@/views/resource/script/CodeModule.vue';

  const codeRef = ref();
  const [registerModal, { setModalProps }] = useModalInner(async (data) => {
    setModalProps({ confirmLoading: false });
    codeRef.value.putCode(data.record.scriptContent);
    codeRef.value.putReadFlag(true);
  });
  const getTitle = '脚本显示';
</script>

<template>
  <BasicModal v-bind="$attrs" @register="registerModal" :title="getTitle" width="70%">
    <CodeModule ref="codeRef" />
    <template #footer></template>
  </BasicModal>
</template>
